package day15;

import java.util.ArrayList;

public class Algorithm07 {
    public static void main(String[] args) {            //不死神兔
        ArrayList<Integer> list = new ArrayList<>();    //法一：暴力
        list.add(0);
        int month=1;
        while(month<=12){
            for (int i = 0; i < list.size(); i++) {
                list.set(i,list.get(i)+1);
                if(list.get(i)>=3){list.add(0);}
            }
            month++;
        }
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        System.out.println(list.size());

        System.out.println(F(12));                  //法二：斐波那契
    }
    private static int F(int i){
        if(i==1||i==2){return 1;}
        return F(i-1)+F(i-2);
    }
}
